import rx.Subscriber;

/**
 * Created by codeczx on 2017/2/16.
 */
public class PrintSubscriber extends Subscriber {

    private String name;

    PrintSubscriber(String name){
        this.name = name;
    }

    @Override
    public void onCompleted() {
        System.out.println(name+":Completed");
    }

    @Override
    public void onError(Throwable throwable) {
        System.out.println(name+":Error "+throwable);
    }

    @Override
    public void onNext(Object o) {
        System.out.println(name+":"+o);
    }
}
